package com.example.cehua

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import kotlinx.android.synthetic.main.activity_list.*

class ListActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_list)
        rv.layoutManager = LinearLayoutManager(this)
        for (i in 0..100) {
            persons.add("item   --   $i")
        }

        rv.adapter = MyAdapter(persons)
    }

    companion object {
        var persons = arrayListOf<String>()
    }
}